import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:yt_devops/components/app_bar/app_bar_widget.dart';
import 'package:yt_devops/pages/site/site_setting/siet_elec_price_setting/site_mains_elec_detail/keep_aliver_wrapper.dart';
import 'package:yt_devops/pages/site/site_device_manager/site_device_manager_controller.dart';
import 'package:yt_devops/pages/site/site_observer_list/views/my_top_tabbar.dart';
import 'package:yt_devops/resources/str_res_keys.dart';
import 'package:yt_devops/routers/router_path.dart';
import 'package:yt_devops/styles/styles.dart';

import 'widgets/device_manager_table_view.dart';

class SiteDeviceManagerView extends GetView<SiteDeviceManagerController> {
  SiteDeviceManagerView({Key? key}) : super(key: key);

  @override
  final controller =
      Get.put(SiteDeviceManagerController(), tag: RouterPath.siteDeviceManager);

  @override
  // final String tag = RouterPath.siteDeviceManager;

  @override
  Widget build(BuildContext context) {
    return
      GetBuilder<SiteDeviceManagerController>(
        builder: (_) {
         return Scaffold(
              appBar: AppBarWidget.defaultAppBar(controller.siteName),
              body: Container(
                color: Colors.white,
                child: Column(
                  children: [
                    Container(
                      color: Colors.white,
                      padding: const EdgeInsets.only(left: 6, right: 6),
                      child: MyTopTabBar(
                          controller.tabController!, controller.tabs,isScrollable: false,),
                    ),
                    // Container(height: 10, color: Colour.backgroundColor),
                    Expanded(
                      child: Container(
                        color: Colour.backgroundColor,
                        child: TabBarView(
                            controller: controller.tabController,
                            children:
                            controller.tabviewList.map((tabview) {
                              return KeepAliveWrapper(tabview);
                            }).toList()),
                      ),
                    ),
                    // Container(height: 10, color: Colour.backgroundColor),
                  ],
                ),
              )
          );
        },
        tag:  RouterPath.siteDeviceManager,
      );

  }

}
